<?php
ini_set("display_errors", "On");
error_reporting(E_ALL);

// 引入数据库连接文件
require_once '../../../../sql/connection.php';

$connCouID = $_POST['connCouID'];
$connTeacherID = $_POST['connTeacherID'];

$now = date('Y-m-d H:i:s', time());
$deleteSql = "UPDATE `teacher-course` SET is_delete = 1 where c_ID = '$connCouID' and t_ID = '$connTeacherID';";

if (mysqli_query($GLOBALS['conn'], $deleteSql)) {
	echo "
            <script>
                alert('取消关联成功！');
                window.location.href=document.referrer;
            </script>
        ";
} else {
	echo "
            <script>
                alert('取消关联失败！');
                history.back();
            </script>
        ";
}